package sseGameApps.meta.mdkbr;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2013-09-28 20:36:49")
/** */
public final class MdKbrUserMeta extends org.slim3.datastore.ModelMeta<sseGameApps.model.mdkbr.MdKbrUser> {

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer> battleCount = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer>(this, "battleCount", "battleCount", java.lang.Integer.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.util.Date> createdAt = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.util.Date>(this, "createdAt", "createdAt", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.CoreUnindexedAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.util.Date> lastLoginDate = new org.slim3.datastore.CoreUnindexedAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.util.Date>(this, "lastLoginDate", "lastLoginDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer> loseCount = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer>(this, "loseCount", "loseCount", java.lang.Integer.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser> passWord = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser>(this, "passWord", "passWord");

    /** */
    public final org.slim3.datastore.CoreUnindexedAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer> permitTime = new org.slim3.datastore.CoreUnindexedAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer>(this, "permitTime", "permitTime", java.lang.Integer.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser> playerCGType = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser>(this, "playerCGType", "playerCGType");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser> playerName = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser>(this, "playerName", "playerName");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser> playerSchool = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser>(this, "playerSchool", "playerSchool");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser> playerSex = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser>(this, "playerSex", "playerSex");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser> playerType = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser>(this, "playerType", "playerType");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.util.Date> updatedAt = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.util.Date>(this, "updatedAt", "updatedAt", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, com.google.appengine.api.datastore.Email> userEmail = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, com.google.appengine.api.datastore.Email>(this, "userEmail", "userEmail", com.google.appengine.api.datastore.Email.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Long> userExp = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Long>(this, "userExp", "userExp", java.lang.Long.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser> userId = new org.slim3.datastore.StringAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser>(this, "userId", "userId");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer> userLevel = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer>(this, "userLevel", "userLevel", java.lang.Integer.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer> winCount = new org.slim3.datastore.CoreAttributeMeta<sseGameApps.model.mdkbr.MdKbrUser, java.lang.Integer>(this, "winCount", "winCount", java.lang.Integer.class);

    private static final org.slim3.datastore.CreationDate slim3_createdAtAttributeListener = new org.slim3.datastore.CreationDate();

    private static final org.slim3.datastore.ModificationDate slim3_updatedAtAttributeListener = new org.slim3.datastore.ModificationDate();

    private static final MdKbrUserMeta slim3_singleton = new MdKbrUserMeta();

    /**
     * @return the singleton
     */
    public static MdKbrUserMeta get() {
       return slim3_singleton;
    }

    /** */
    public MdKbrUserMeta() {
        super("MdKbrUser", sseGameApps.model.mdkbr.MdKbrUser.class);
    }

    @Override
    public sseGameApps.model.mdkbr.MdKbrUser entityToModel(com.google.appengine.api.datastore.Entity entity) {
        sseGameApps.model.mdkbr.MdKbrUser model = new sseGameApps.model.mdkbr.MdKbrUser();
        model.setBattleCount(longToInteger((java.lang.Long) entity.getProperty("battleCount")));
        model.setCreatedAt((java.util.Date) entity.getProperty("createdAt"));
        model.setKey(entity.getKey());
        model.setLastLoginDate((java.util.Date) entity.getProperty("lastLoginDate"));
        model.setLoseCount(longToInteger((java.lang.Long) entity.getProperty("loseCount")));
        model.setPassWord((java.lang.String) entity.getProperty("passWord"));
        model.setPermitTime(longToInteger((java.lang.Long) entity.getProperty("permitTime")));
        model.setPlayerCGType((java.lang.String) entity.getProperty("playerCGType"));
        model.setPlayerName((java.lang.String) entity.getProperty("playerName"));
        model.setPlayerSchool((java.lang.String) entity.getProperty("playerSchool"));
        model.setPlayerSex((java.lang.String) entity.getProperty("playerSex"));
        model.setPlayerType((java.lang.String) entity.getProperty("playerType"));
        model.setUpdatedAt((java.util.Date) entity.getProperty("updatedAt"));
        model.setUserEmail((com.google.appengine.api.datastore.Email) entity.getProperty("userEmail"));
        model.setUserExp((java.lang.Long) entity.getProperty("userExp"));
        model.setUserId((java.lang.String) entity.getProperty("userId"));
        model.setUserLevel(longToInteger((java.lang.Long) entity.getProperty("userLevel")));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        model.setWinCount(longToInteger((java.lang.Long) entity.getProperty("winCount")));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        sseGameApps.model.mdkbr.MdKbrUser m = (sseGameApps.model.mdkbr.MdKbrUser) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("battleCount", m.getBattleCount());
        entity.setProperty("createdAt", m.getCreatedAt());
        entity.setUnindexedProperty("lastLoginDate", m.getLastLoginDate());
        entity.setProperty("loseCount", m.getLoseCount());
        entity.setProperty("passWord", m.getPassWord());
        entity.setUnindexedProperty("permitTime", m.getPermitTime());
        entity.setProperty("playerCGType", m.getPlayerCGType());
        entity.setProperty("playerName", m.getPlayerName());
        entity.setProperty("playerSchool", m.getPlayerSchool());
        entity.setProperty("playerSex", m.getPlayerSex());
        entity.setProperty("playerType", m.getPlayerType());
        entity.setProperty("updatedAt", m.getUpdatedAt());
        entity.setProperty("userEmail", m.getUserEmail());
        entity.setProperty("userExp", m.getUserExp());
        entity.setProperty("userId", m.getUserId());
        entity.setProperty("userLevel", m.getUserLevel());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("winCount", m.getWinCount());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        sseGameApps.model.mdkbr.MdKbrUser m = (sseGameApps.model.mdkbr.MdKbrUser) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        sseGameApps.model.mdkbr.MdKbrUser m = (sseGameApps.model.mdkbr.MdKbrUser) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        sseGameApps.model.mdkbr.MdKbrUser m = (sseGameApps.model.mdkbr.MdKbrUser) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        sseGameApps.model.mdkbr.MdKbrUser m = (sseGameApps.model.mdkbr.MdKbrUser) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
        sseGameApps.model.mdkbr.MdKbrUser m = (sseGameApps.model.mdkbr.MdKbrUser) model;
        m.setCreatedAt(slim3_createdAtAttributeListener.prePut(m.getCreatedAt()));
        m.setUpdatedAt(slim3_updatedAtAttributeListener.prePut(m.getUpdatedAt()));
    }

    @Override
    protected void postGet(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        sseGameApps.model.mdkbr.MdKbrUser m = (sseGameApps.model.mdkbr.MdKbrUser) model;
        writer.beginObject();
        org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default();
        if(m.getBattleCount() != null){
            writer.setNextPropertyName("battleCount");
            encoder0.encode(writer, m.getBattleCount());
        }
        if(m.getCreatedAt() != null){
            writer.setNextPropertyName("createdAt");
            encoder0.encode(writer, m.getCreatedAt());
        }
        if(m.getKey() != null){
            writer.setNextPropertyName("key");
            encoder0.encode(writer, m.getKey());
        }
        if(m.getLastLoginDate() != null){
            writer.setNextPropertyName("lastLoginDate");
            encoder0.encode(writer, m.getLastLoginDate());
        }
        if(m.getLoseCount() != null){
            writer.setNextPropertyName("loseCount");
            encoder0.encode(writer, m.getLoseCount());
        }
        if(m.getPassWord() != null){
            writer.setNextPropertyName("passWord");
            encoder0.encode(writer, m.getPassWord());
        }
        if(m.getPermitTime() != null){
            writer.setNextPropertyName("permitTime");
            encoder0.encode(writer, m.getPermitTime());
        }
        if(m.getPlayerCGType() != null){
            writer.setNextPropertyName("playerCGType");
            encoder0.encode(writer, m.getPlayerCGType());
        }
        if(m.getPlayerName() != null){
            writer.setNextPropertyName("playerName");
            encoder0.encode(writer, m.getPlayerName());
        }
        if(m.getPlayerSchool() != null){
            writer.setNextPropertyName("playerSchool");
            encoder0.encode(writer, m.getPlayerSchool());
        }
        if(m.getPlayerSex() != null){
            writer.setNextPropertyName("playerSex");
            encoder0.encode(writer, m.getPlayerSex());
        }
        if(m.getPlayerType() != null){
            writer.setNextPropertyName("playerType");
            encoder0.encode(writer, m.getPlayerType());
        }
        if(m.getUpdatedAt() != null){
            writer.setNextPropertyName("updatedAt");
            encoder0.encode(writer, m.getUpdatedAt());
        }
        if(m.getUserEmail() != null){
            writer.setNextPropertyName("userEmail");
            encoder0.encode(writer, m.getUserEmail());
        }
        if(m.getUserExp() != null){
            writer.setNextPropertyName("userExp");
            encoder0.encode(writer, m.getUserExp());
        }
        if(m.getUserId() != null){
            writer.setNextPropertyName("userId");
            encoder0.encode(writer, m.getUserId());
        }
        if(m.getUserLevel() != null){
            writer.setNextPropertyName("userLevel");
            encoder0.encode(writer, m.getUserLevel());
        }
        if(m.getVersion() != null){
            writer.setNextPropertyName("version");
            encoder0.encode(writer, m.getVersion());
        }
        if(m.getWinCount() != null){
            writer.setNextPropertyName("winCount");
            encoder0.encode(writer, m.getWinCount());
        }
        writer.endObject();
    }

    @Override
    protected sseGameApps.model.mdkbr.MdKbrUser jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        sseGameApps.model.mdkbr.MdKbrUser m = new sseGameApps.model.mdkbr.MdKbrUser();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default();
        reader = rootReader.newObjectReader("battleCount");
        m.setBattleCount(decoder0.decode(reader, m.getBattleCount()));
        reader = rootReader.newObjectReader("createdAt");
        m.setCreatedAt(decoder0.decode(reader, m.getCreatedAt()));
        reader = rootReader.newObjectReader("key");
        m.setKey(decoder0.decode(reader, m.getKey()));
        reader = rootReader.newObjectReader("lastLoginDate");
        m.setLastLoginDate(decoder0.decode(reader, m.getLastLoginDate()));
        reader = rootReader.newObjectReader("loseCount");
        m.setLoseCount(decoder0.decode(reader, m.getLoseCount()));
        reader = rootReader.newObjectReader("passWord");
        m.setPassWord(decoder0.decode(reader, m.getPassWord()));
        reader = rootReader.newObjectReader("permitTime");
        m.setPermitTime(decoder0.decode(reader, m.getPermitTime()));
        reader = rootReader.newObjectReader("playerCGType");
        m.setPlayerCGType(decoder0.decode(reader, m.getPlayerCGType()));
        reader = rootReader.newObjectReader("playerName");
        m.setPlayerName(decoder0.decode(reader, m.getPlayerName()));
        reader = rootReader.newObjectReader("playerSchool");
        m.setPlayerSchool(decoder0.decode(reader, m.getPlayerSchool()));
        reader = rootReader.newObjectReader("playerSex");
        m.setPlayerSex(decoder0.decode(reader, m.getPlayerSex()));
        reader = rootReader.newObjectReader("playerType");
        m.setPlayerType(decoder0.decode(reader, m.getPlayerType()));
        reader = rootReader.newObjectReader("updatedAt");
        m.setUpdatedAt(decoder0.decode(reader, m.getUpdatedAt()));
        reader = rootReader.newObjectReader("userEmail");
        m.setUserEmail(decoder0.decode(reader, m.getUserEmail()));
        reader = rootReader.newObjectReader("userExp");
        m.setUserExp(decoder0.decode(reader, m.getUserExp()));
        reader = rootReader.newObjectReader("userId");
        m.setUserId(decoder0.decode(reader, m.getUserId()));
        reader = rootReader.newObjectReader("userLevel");
        m.setUserLevel(decoder0.decode(reader, m.getUserLevel()));
        reader = rootReader.newObjectReader("version");
        m.setVersion(decoder0.decode(reader, m.getVersion()));
        reader = rootReader.newObjectReader("winCount");
        m.setWinCount(decoder0.decode(reader, m.getWinCount()));
        return m;
    }
}